<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%>
<t:link />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>注册账户</title>
</head>


<body>
	<div>
		<table>
			<tr>
				<td>用户名:</td>
				<td><input id="username" type="text"></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input id="password" type="password"></td>
			</tr>
			<tr>
				<td>邮箱:</td>
				<td><input id="email" type="text"></td>
			</tr>
			<tr>
				<button id="btn">注册</button>
			</tr>
		</table>
	</div>
</body>


<script>
	$().ready(function() {

	})

	$("#btn").click(function() {
		var username = $("#username").val();
		var password = $("#password").val();
		var email = $("#email").val();
		$.ajax({
			type : "post",
			url : "${pageContext.request.contextPath}/ponal/registerdata",
			data : {
				username : username,
				password : password,
				email : email
			},
			contentType : "application/x-www-form-urlencoded; charset=utf-8",
			success : function(data) {
				if ("1" == data) {
					alert("请完成邮箱验证,然后登录系统!")
				}
			},
			error : function(data) {
				alert(data)
			}
		})
	})
</script>

</html>